package exam.test11.q1;

import org.junit.Test;

import java.util.List;

import static org.junit.Assert.*;

public class TreeBuilderTest {



    @Test(timeout = 1000)
    public void testBuildOddNumber() {
        String text = "23 87 i Am the KING of THE 10 castle. The castle 11 2 5 3 is my HOME.";
        TreeBuilder builder = new TreeBuilder();
        RBTree<Integer, List<String>> tree = builder.build(text);
        assertEquals(2, tree.getData(1).size());
        assertEquals(3, tree.getData(2).size());

        assertTrue(tree.getData(1).contains("5") && tree.getData(1).contains("3"));
        assertTrue(tree.getData(2).contains("23") && tree.getData(2).contains("87") && tree.getData(2).contains("11"));
    }


}
